package com.group9.handinhand.service;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.group9.handinhand.service.so.CommunityMemberSO;
import com.group9.handinhand.service.so.CommunityPostSO;
import com.group9.handinhand.service.so.CommunitySO;
import com.group9.handinhand.service.so.MembershipRequestSO;
import com.group9.handinhand.service.so.UserSO;
import com.group9.handinhand.service.so.UserTagSO;
/**
 * 
 * Interface that defines the community service.
 *
 */
public interface CommunityService {
	
	static final Logger logger = LoggerFactory.getLogger(CommunityService.class);
		
	public CommunitySO getCommunityById(Long communityId);
	
	public void updateCommunity(CommunitySO community);
	
	public List<CommunitySO> getCommunitiesByUser(UserSO user);

	public CommunityMemberSO saveCommunityMember(CommunitySO newCommunity, UserSO user);
	
	public MembershipRequestSO saveMembershipRequest(CommunitySO newCommunity, UserSO user);

	public CommunitySO saveCommunity(CommunitySO community, UserSO user);

	public CommunityPostSO saveCommunityPost(Long communityId,Long userId, String post);

	public CommunityMemberSO getCommunityMemberByCommunityIdAndUserId(Long communityId, Long userId);
	
	public CommunitySO getModeratedCommunityByCommunityIdAndUserId(Long communityId, Long userId);
	
	public MembershipRequestSO getMembershipRequestByCommunityIdAndUserId(Long communityId, Long userId);
	
	public List<CommunitySO> getCommunitiesByTag(UserTagSO tag);
	
	public List<CommunitySO> getCommunitiesByTagKeyword(String keyword);
	
	public List<CommunitySO> getCommunitiesByName(String keyword);
	
	public List<UserSO> getModeratorsByCommunityId(Long communityId);

	public ArrayList<MembershipRequestSO> getMembershipRequests(Long communityId);

	public void deleteMembershipRequest(Long communityId, Long userId);

	public ArrayList<CommunitySO> getCommunityRecommendations(CommunitySO community, UserSO user);
	
}